// 用户-隐私协议

<template>
  <view class="agreement">
    <rich-text :nodes="agreement"></rich-text>
  </view>
</template>

<script>
export default {
  data() {
    return {
      agreement: ''
    }
  },
  onLoad(options) {
    const type = options.type
    uni.setNavigationBarTitle({
      title: type === 'user' ? '用户协议' : '隐私协议'
    })
    this.getData(type)
  },
  methods: {
    // 获取数据
    async getData(type) {
      const res = await this.$api.set.index({
        name: type === 'user' ? 'agreement' : 'privacy'
      })
      if (res.code == 200) {
        this.agreement = res.data[0].value
      }
    }
  }
}
</script>

<style lang="less" scoped>
.agreement {
  padding: 0 24rpx 24rpx;
}
</style>
